package com.booking.dao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.booking.dao.entity.GroupingOrder;
import com.booking.dao.mapper.GroupingOrderMapper;
import com.booking.dao.service.GroupingOrderService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Qikai.Lin
 * @date 2023/4/23
 */
@Service
public class GroupingOrderServiceImpl extends ServiceImpl<GroupingOrderMapper, GroupingOrder>
        implements GroupingOrderService {
    @Override
    public List<GroupingOrder> getListByGroupingId(Long groupingId) {
        QueryWrapper<GroupingOrder> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("grouping_id", groupingId);
        return this.baseMapper.selectList(queryWrapper);
    }

    @Override
    public List<GroupingOrder> getListByVisitorId(Long visitorId) {
        QueryWrapper<GroupingOrder> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("visitor_id", visitorId);
        return this.baseMapper.selectList(queryWrapper);
    }

}
